from PyQt5.QtWidgets import QApplication, QWidget, QVBoxLayout, QListWidget, QPushButton

class MyWindow(QWidget):
    def __init__(self):
        super().__init__()

        self.setLayout(QVBoxLayout())

        self.listWidget = QListWidget()
        self.layout().addWidget(self.listWidget)

        self.deleteButton = QPushButton("删除")
        self.layout().addWidget(self.deleteButton)

        self.deleteButton.clicked.connect(self.deleteSelectedItem)

        # 添加一些默认项
        self.listWidget.addItem("新的按钮1")
        self.listWidget.addItem("新的按钮2")
        self.listWidget.addItem("新的按钮3")

    def deleteSelectedItem(self):
        selectedItems = self.listWidget.selectedItems()
        for item in selectedItems:
            row = self.listWidget.row(item)
            self.listWidget.takeItem(row)

app = QApplication([])
window = MyWindow()
window.show()
app.exec_()